// hyb_yl/krecovery/pages/followUp/followUp.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    var back_orser = options.back_orser;
    var j_id = options.j_id;
    that.setData({
      back_orser:back_orser,
      j_id:j_id,
      names:options.names,
      telphone:options.telphone,
      back_orser:options.back_orser,
      numcard:options.numcard,
      sex:options.sex,
      openid:options.openid,
      age:options.age,
      zid:options.zid
    })
  },
  changecontent:function(){
    this.setData({
      beizhu:e.detail.value
    })
  },
  save:function(){
    var that = this;
    var days = that.data.days;
    var beizhu = that.data.beizhu;
    if(days == '')
    {
      wx.showToast({
        title: '请选择随访时间',
      })
    }else if(beizhu == '')
    {
      wx.showToast({
        title: '请填写随访内容',
      })
    }else{
      app.util.reuqest({
        'url':"entry/wxapp/green.add_suifang",
        data:{
          beizhu:beizhu,
          next_time:days,
          openid:that.data.openid,
          zid:that.data.zid,
          j_id:that.data.j_id,
          age:that.data.age,
          numcard:that.data.numcard,
          telphone:that.data.telphone,
          sex:that.data.sex,
          names:that.data.names,
          back_orser:that.data.back_orser,
        },
        success:function(res){
          wx.navigateBack({
          })
        }
      })
    }
  },
  totime:function(){
    var that = this;
    var back_orser = that.data.back_orser;
    var j_id = that.data.j_id;
    var names = that.data.names;
    var telphone = that.data.telphone;
    var back_orser = that.data.back_orser;
    var numcard = that.data.numcard;
    var sex = that.data.sex;
    var openid = that.data.openid;
    wx.navigateTo({
      url: '/hyb_yl/krecovery/pages/followUp_editTime/followUp_editTime?j_id='+j_id+'&names='+names+'&telphone='+telphone+'&back_orser='+back_orser+'&numcard='+numcard+'&sex='+sex+'&openid='+openid,
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})